use Tk;

# 设置utf-8编码
use utf8;

my $mw = MainWindow->new(-title => "Grid 布局示例");

$mw->Label(-text => "用户名:")->grid(-row => 0, -column => 0, -sticky => "w", -padx => 5, -pady => 5);
$mw->Entry(-width => 20)->grid(-row => 0, -column => 1, -padx => 5, -pady => 5);

$mw->Label(-text => "密码:")->grid(-row => 1, -column => 0, -sticky => "w", -padx => 5, -pady => 5);
$mw->Entry(-width => 20, -show => "*")->grid(-row => 1, -column => 1, -padx => 5, -pady => 5);

$mw->Button(-text => "登录")->grid(-row => 2, -column => 0, -columnspan => 2, -pady => 10);

MainLoop;